package com.sunny.shop.repository;

import com.sunny.shop.model.Good;
import com.sunny.shop.model.Song;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SongRepository extends JpaRepository<Song, Long> {
    @Query("select r from Song as r")
    List<Song> findLimitAll(Pageable pageable);

    Song findOneById(Long id);

    @Query("select r from Song as r where r.cateId = :cateId")
    List<Song> findLimitByCateId(Long cateId, Pageable pageable);
}
